package com.test.qpbgboot.user.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserPasswordParam {
    @ApiModelProperty(value = "用户id",required = true)
    @NotNull(message = "用户id不能为空")
    private Long id;
    @ApiModelProperty(value = "旧密码",required = true)
    @NotBlank(message = "旧密码不能为空")
    private String oldPassword;
    @ApiModelProperty(value = "新密码",required = true)
    @NotBlank(message = "新密码不能为空")
    @Size(min = 6, max = 16, message = "密码长度必须在6到16位之间")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{6,16}$",
            message = "密码只能且必须包含大写字母、小写字母和数字")
    private String password;
}
